"""
继承，python支持多继承

# class Phone:
#     IMEI = None
#     producer = None
#
#     def call_by_4g(self):
#         print("4G通话")
#
#
# # （Phone）代表继承Phone
# class Phone2022(Phone):
#     face_id = None
#
#     def call_by_5g(self):
#         print(f"5G通话{self.IMEI}:{self.face_id}")
#
#
# phone = Phone2022()
# phone.face_id = "10111"
# phone.IMEI = "11111111"
# phone.call_by_5g()
"""


# 多继承Demo， 父类属性名相同的情况下，最近的父类优先级最高
class Phone:
    IMEI = None
    producer = "ZHONGGUO"

    def call_by_4g(self):
        print("4G通话")


class NFCReader:
    nfc_type = "五代"


class XimiPhone(Phone, NFCReader):
    # pass  # 表示空，补全语法，使语法不报错
    producer = "XIAOMI"

    def call_by_4g(self):
        # 这是第一种调用父类的属性和方法 XXX.xxx
        # print(Phone.producer)
        # Phone.call_by_4g(self)

        # 这是第二种 super().xxxx
        super().call_by_4g()
        print(f"4G被覆盖{self.producer}--父类{super().producer}")


x = XimiPhone()
x.call_by_4g()
